import Vue from "vue";
import Vuex from "vuex";

import login from "./modules/login";
import app from "./modules/app";
import createPersistedState from "vuex-persistedstate";
Vue.use(Vuex);
const store = new Vuex.Store({
  modules: {
    login,
    app,
  },

  plugins: [
    createPersistedState({
      // 不配置paths就是所以的模块都缓存
      paths: ["login.token"],
    }),
  ],
});
export default store;
